import { CACHE_MANAGER } from '@nestjs/cache-manager';
import { Inject, Injectable } from '@nestjs/common';
import { Cache } from '@nestjs/cache-manager'
import { RedisClientType } from 'redis'
@Injectable()
export class RedisService {
    constructor(
        @Inject(CACHE_MANAGER)
        private readonly cacheManager: Cache,


    ) { }

    async get<T>(key: string): Promise<T> {

        return await this.cacheManager.get(key);
    }

    async set(key: string, value: any, ttl?: number): Promise<void> {
        return await this.cacheManager.set(key, value, ttl);
    }
    async getHello() {
        // const value = await this.cacheManager.keys('*')


        return 'Hello World!'
    }
}
